﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

namespace DungeonGenerator
{
    public class MapLevel31 : BaseMapBuilder
    {
        List<Node> arena;
        IService service;

        public MapLevel31()
        {
            levelMap = new BaseMapData();
            service = new MockService();
            arena = new List<Node>();
        }

        public override void BuildMap()
        {
            for (int i = 0; i < 8; i++)
            {
                Node node = new Node();
                arena.Add(node);
            }

            arena[0].Id = 1;
            arena[0].Weight = 0;
            arena[0].Position = new Vector2(-7.4f, 0.6f);
            arena[0].Connection.Add(arena[1]);
            arena[0].Connection.Add(arena[2]);

            arena[1].Id = 2;
            arena[1].Weight = service.Getheart(10).TotalStat;
            arena[1].Position = new Vector2(-3.2f, 3.5f);
            arena[1].Connection.Add(arena[3]);
            arena[1].Connection.Add(arena[4]);

            arena[2].Id = 3;
            arena[2].Weight = service.Getheart(10).TotalStat;
            arena[2].Position = new Vector2(-4.5f, -2.2f);
            arena[2].Connection.Add(arena[3]);
            arena[2].Connection.Add(arena[4]);

            arena[3].Id = 4;
            arena[3].Weight = service.Getheart(10).TotalStat;
            arena[3].Position = new Vector2(0.1f, 3.4f);
            arena[3].Connection.Add(arena[5]);
            arena[3].Connection.Add(arena[6]);

            arena[4].Id = 5;
            arena[4].Weight = service.Getheart(10).TotalStat;
            arena[4].Position = new Vector2(0.5f, -1.5f);
            arena[4].Connection.Add(arena[5]);
            arena[4].Connection.Add(arena[6]);

            arena[5].Id = 6;
            arena[5].Weight = service.Getheart(10).TotalStat;
            arena[5].Position = new Vector2(4, 2.5f);
            arena[5].Connection.Add(arena[7]);

            arena[6].Id = 7;
            arena[6].Weight = service.Getheart(10).TotalStat;
            arena[6].Position = new Vector2(4.5f, -2);
            arena[6].Connection.Add(arena[7]);

            arena[7].Id = 8;
            arena[7].Weight = service.Getheart(10).TotalStat;
            arena[7].Position = new Vector2(6.8f, 2);

            foreach (Node i in arena)
            {
                //Debug.Log(i.Id + " " + i.Weight);
                levelMap.Nodes.Add(i);
            }
        }
    }
}